|
class Behavior |
|
Parent: Entity |
|
|
Methods:always_face_camera=, always_face_camera?, cuts_opening=, cuts_opening?, is2d=, is2d?, snapto, snapto= |
|
|
Sample Code: behaviortests.rb |
|
|
Instance Methods |
|
always_face_camera= |
|
The always_face_camera= method is used to set the always_face_camera behavior for a component. |
|
Syntax: |
|
status = behavior.always_face_camera=true | false |
|
Arguments: |
|
true – sets the always_face_camera behavior to true false – sets the always_face_camera behavior to false |
|
Return Value: |
|
status – the status of the always_face_camera behavior if successful |
|
Comments: |
|
If the always_face_camera behavior is true, a component will always try to orient itself so that the Y axis of the component is facing the camera. |
|
Example: |
|
status = behavior.always_face_camera=false if (status) |
|
always_face_camera? |
|
The always_face_camera? method is used to retrieve the always_face_camera behavior for a component. |
|
Syntax: |
|
behvior = behavior.always_face_camera? |
|
Arguments: |
|
|
|
Return Value: |
|
behavior - true if the component is set to always face the camera, false if the component is not set to always face camera. |
|
Comments: |
|
If the always_face_camera behavior is true, then a component will always try to orient itself so that the -Y axis of the component is facing the camera. |
|
Example: |
|
model = Sketchup.active_model status = behavior.always_face_camera
= true |
|
cuts_opening= |
|
The cuts_opening= method is used to set the cut opening behavior for a component. |
|
Syntax: |
|
status = behavior.cuts_opening=true | false |
|
Arguments: |
|
true – sets the cuts_opening behavior to true false – sets the cuts_opening behavior to false |
|
Return Value: |
|
status – the status of the cuts_opening behavior (either true or false) |
|
Comments: |
|
|
|
Example: |
|
status = behavior.cuts_opening=false if (status) |
|
cuts_opening? |
|
The cuts_opening? method is used to verify the status of a component’s cut opening behavior. |
|
Syntax: |
|
status = behavior.cuts_opening? |
|
Arguments: |
|
|
|
Return Value: |
|
status – the status of the cuts_opening behavior (either true or false) |
|
Comments: |
|
|
|
Example: |
|
staus=behavior.cuts_opening? if (status) |
|
is2d= |
|
The is2d= method is used to set the 2D behavior for a component: whether it can be glued or aligned to a face. |
|
Syntax: |
|
status = behavior.is2d=true | false |
|
Arguments: |
|
true – sets the 2D behavior to true false – sets the 2D behavior to false |
|
Return Value: |
|
status – the status of the 2D behavior (either true or false) |
|
Comments: |
|
|
|
Example: |
|
status = behavior.is2d=false if (status) |
|
is2d? |
|
The is2d? method is used to verify the status of a component’s 2D behavior. |
|
Syntax: |
|
status = behavior.is2d? |
|
Arguments: |
|
|
|
Return Value: |
|
status – the status of the 2D behavior (either true or false) |
|
Comments: |
|
|
|
Example: |
|
staus=behavior.is2d? if (status) |
|
snapto |
|
The snapto method is used to verify the status of a component’s "snap to" behavior. |
|
Syntax: |
|
status = behavior.snapto |
|
Arguments: |
|
|
|
Return Value: |
|
status – the status of the snapto behavior (either true or false) |
|
Comments: |
|
If the always_face_camera behavior is true, a component will always try to orient itself so that the Y axis of the component is facing the camera. |
|
Example: |
|
staus=behavior.snapto? if (status) |
|
snapto= |
|
The is2d= method is used to set the snap to behavior for a component: whether it aligns (snaps) to a particular orientation. |
|
Syntax: |
|
status = behavior.snapto=true | false |
|
Arguments: |
|
true – sets the snapto behavior to true false – sets the snapto behavior to false |
|
Return Value: |
|
status – the status of the snapto behavior (either true or false) |
|
Comments: |
|
|
|
Example: |
|
status = behavior.snapto=false if (status) |